<template>
  <el-menu
    default-active="1-1"
    class="el-menu-vertical-demo"
    @open="handleOpen"
    @close="handleClose"
    @select="selectFnc"
    >
    <el-submenu index="1">
      <template slot="title">
        <span>关联分析</span>
      </template>
      <el-menu-item index="1-1">GRA</el-menu-item>
      <el-menu-item index="1-2">Apriori</el-menu-item>
    </el-submenu>
    <el-menu-item index="2">
      <span slot="title">聚类分析</span>
    </el-menu-item>
    <el-menu-item index="3">
      <span slot="title">异常检测</span>
    </el-menu-item>
  </el-menu>
</template>

<script>
export default {
  name: 'tab',
  props: {
    // eltabs: {
    //   type: Array,
    //   default: () => []
    // },
    // activeName: {
    //   type: String,
    //   default: () => '1'
    // },
  },
  data () {
    return {
      // activeName: '1'
    }
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    selectFnc(index, indexPath) {
      console.log(index, indexPath);
      this.$emit('tabIndex', index)
    }
    
    // handleClick (tab) {
    //   this.activeName = tab.name
    //   this.$emit('tabIndex', tab.name)
    // }
  }
}
</script>

<style lang="scss" scoped="scoped">
</style>
